﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AddressBook.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="AddressBook.Web.Default" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContentPlaceHolder" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="MainPaneContentPlaceHolder" runat="server">
	<asp:MultiView ID="DefaultContactMultiView" runat="server" ActiveViewIndex="0">
		<asp:View ID="DefaultContactGridView" runat="server">
			<table id="DefaultTable" border="0" cellpadding="0" cellspacing="0">
				<tr>
					<td>
						<div style="float: left;">
							<table border="0" cellpadding="2" cellspacing="0" style="padding: 6px 0px; height: 18px;">
								<tr>
									<td>
										<asp:TextBox ID="DefaultSearchTextBox" runat="server" />
									</td>
									<td>
										<asp:ImageButton ID="DefaultSearchImageButton" runat="server" ImageUrl="~/Images/search_16.png" AlternateText="Search Contacts" ToolTip="Search Contacts" OnClick="DefaultSearchImageButton_Click" style="padding: 2px 0px;" />
									</td>
									<td>
										<asp:ImageButton ID="DefaultClearSearchImageButton" runat="server" ImageUrl="~/Images/clear_search_16.png" AlternateText="Clear Search" ToolTip="Clear Search" OnClick="DefaultClearSearchImageButton_Click" style="padding: 2px 0px;" />
									</td>
								</tr>
							</table>
						</div>
						<div style="padding: 10px 2px; float: right;">
							<asp:LinkButton ID="DefaultAddContactButton" runat="server" Text="Add Contact" />
						</div>
					</td>
				</tr>
				<tr>
					<td>
						<asp:GridView ID="DefaultContactGrid" runat="server" AutoGenerateColumns="False" 
													AlternatingRowStyle-CssClass="DefaultContactGridAltRow" 
													HeaderStyle-CssClass="DefaultContactGridHeader"
													RowStyle-CssClass="DefaultContactGridRow"
													AllowSorting="true" GridLines="None" CssClass="DefaultContactGrid"
													BorderWidth="1px" BorderColor="#000000" BorderStyle="Solid"
													OnRowCommand="DefaultContactGrid_RowCommand" 
													OnRowEditing="DefaultContactGrid_RowEditing"
													OnRowDeleting="DefaultContactGrid_RowDeleting" 
													AllowPaging="true" PageSize="10" 
													OnPageIndexChanging="DefaultContactGrid_PageIndexChanging" >
							<Columns>
								<asp:TemplateField Visible="False">
									<ItemTemplate>
										<asp:Label ID="ContactId" runat="server" Text='<%# Eval("Id") %>' />
									</ItemTemplate>
								</asp:TemplateField>
								<asp:TemplateField>
									<HeaderTemplate>
										<table border="0" cellpadding="0" cellspacing="0">
											<tr>
												<td style="width: 20px;"></td>
												<td style="width: 20px;"></td>
												<td align="left" style="width: 100px;"><asp:Label ID="FirstName" runat="server" Text='First Name' /></td>
												<td align="left" style="width: 100px;"><asp:Label ID="LastName" runat="server" Text='Last Name' /></td>
												<td align="left" style="width: 200px;"><asp:Label ID="HomeAddress" runat="server" Text='Home Address' /></td>
												<td align="left" style="width: 100px;"><asp:Label ID="HomePhone" runat="server" Text='Home Phone' /></td>
												<td align="left" style="width: 100px;"><asp:Label ID="CellPhone" runat="server" Text='Cell Phone' /></td>
											</tr>
										</table>
									</HeaderTemplate>
									<ItemTemplate>
										<table border="0" cellpadding="0" cellspacing="0">
											<tr>
												<td style="width: 20px;"><asp:ImageButton ID="EditContactButton" runat="server" ImageUrl="~/Images/open_contact_16.png" AlternateText="Open Contact" ToolTip="Open Contact" CommandName="Edit" CommandArgument='<%# Eval("Id") %>' /></td>
												<td style="width: 20px;"><asp:ImageButton ID="DeleteContactButton" runat="server" ImageUrl="~/Images/delete_16.png" AlternateText="Delete Contact" ToolTip="Delete Contact" CommandName="Delete" CommandArgument='<%# Eval("Id") %>' /></td>
												<td style="width: 100px;"><asp:Label ID="ContactFirstName" runat="server" Text='<%# Eval("FirstName") %>' /></td>
												<td style="width: 100px;"><asp:Label ID="ContactLastName" runat="server" Text='<%# Eval("LastName") %>' /></td>
												<td style="width: 200px;"><asp:Label ID="ContactHomeAddress" runat="server" Text='<%# Eval("HomeAddress") %>' /></td>
												<td style="width: 100px;"><asp:Label ID="ContactHomePhone" runat="server" Text='<%# Eval("HomePhone") %>' /></td>
												<td style="width: 100px;"><asp:Label ID="ContactCellPhone" runat="server" Text='<%# Eval("CellPhone") %>' /></td>
											</tr>
										</table>
										<cc1:ConfirmButtonExtender ID="DeleteContactButtonConfirmExtender" runat="server" 
																							 TargetControlID="DeleteContactButton" 
																							 ConfirmText="Are you sure you want to delete this contact?" />
									</ItemTemplate>
								</asp:TemplateField>
							</Columns>
						</asp:GridView>
					</td>
				</tr>
			</table>
			
			<cc1:ModalPopupExtender ID="DefaultAddContactModalExtender" runat="server" 
															PopupControlID="DefaultAddContactPanel" 
															TargetControlID="DefaultAddContactButton" 
															BackgroundCssClass="modalBackground" />
															
			<asp:Panel ID="DefaultAddContactPanel" runat="server" CssClass="PopupPanel" style="display: none;">
				<div class="PopupHeader">
					Add Contact
					<div style="float: right">
					  <asp:ImageButton ID="DefaultAddContactSaveButton" runat="server" ImageUrl="~/Images/save_16.png" AlternateText="Save Contact" ToolTip="Save Contact" OnClick="DefaultAddContactSaveButton_Click" style="margin-right: 4px;" ValidationGroup="AddContact"  />
					  <asp:ImageButton ID="DefaultAddContactCloseButton" runat="server" ImageUrl="~/Images/close_16.png" AlternateText="Close" ToolTip="Close" OnClick="DefaultAddContactCloseButton_Click" />
					</div>
				</div>
				<table border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td colspan="2">
							<asp:ValidationSummary ID="AddContactValidationSummary" runat="server" 
																		 ValidationGroup="AddContact" 
																		 DisplayMode="List" />
						</td>
					</tr>
					<tr>
						<td><asp:Literal ID="DefaultAddContactTitleLiteral" runat="server" Text="Title" /></td>
						<td>
							<asp:TextBox ID="DefaultAddContactTitleTextBox" runat="server" MaxLength="8" />
						</td>				
					</tr>
					<tr>
						<td><asp:Literal ID="DefaultAddContactFirstNameLiteral" runat="server" Text="First Name" /></td>
						<td>
							<asp:TextBox ID="DefaultAddContactFirstNameTextBox" runat="server" MaxLength="50" />
							<asp:RequiredFieldValidator ID="AddContactFirstNameRequiredValidator" runat="server" 
																					ErrorMessage="First name is required." 
																					ControlToValidate="DefaultAddContactFirstNameTextBox" 
																					ValidationGroup="AddContact" 
																					Display="None" />
						</td>				
					</tr>
					<tr>
						<td><asp:Literal ID="DefaultAddContactMiddleNameLiteral" runat="server" Text="Middle Name" /></td>
						<td>
							<asp:TextBox ID="DefaultAddContactMiddleNameTextBox" runat="server" MaxLength="50" />
						</td>				
					</tr>
					<tr>
						<td><asp:Literal ID="DefaultAddContactLastNameLiteral" runat="server" Text="Last Name" /></td>
						<td>
							<asp:TextBox ID="DefaultAddContactLastNameTextBox" runat="server" MaxLength="50" />
							<asp:RequiredFieldValidator ID="AddContactLastNameRequiredValidator" runat="server" 
																					ErrorMessage="Last name is required." 
																					ControlToValidate="DefaultAddContactLastNameTextBox" 
																					ValidationGroup="AddContact" 
																					Display="None" />
						</td>				
					</tr>
					<tr>
						<td><asp:Literal ID="DefaultAddContactSuffixLiteral" runat="server" Text="Suffix" /></td>
						<td>
							<asp:TextBox ID="DefaultAddContactSuffixTextBox" runat="server" MaxLength="10" />
						</td>
					</tr>
				</table>
			</asp:Panel>
		</asp:View>
		
		<asp:View ID="DefaultContactEditView" runat="server">
			<asp:Panel ID="DefaultEditContactPanel" runat="server" CssClass="EditContactPanel">
				<div align="left" class="ContactHeader">
					Edit Contact
					<div align="right" style="float: right;">
						<asp:ImageButton ID="DefaultEditContactSaveButton" runat="server" ImageUrl="~/Images/save_16.png" AlternateText="Save Contact" ToolTip="Save Contact" OnClick="DefaultEditContactSaveButton_Click" ValidationGroup="EditContact" style="margin-right: 5px;" />
						<asp:ImageButton ID="DefaultEditContactCloseButton" runat="server" ImageUrl="~/Images/close_16.png" AlternateText="Close" ToolTip="Close" OnClick="DefaultEditContactCloseButton_Click" />
					</div>
				</div>
				<table border="0" cellspacing="0" cellpadding="0">
				  <tr>
				    <td valign="top">
				      <div class="Details">
					      <div align="left" class="DetailsHeader">
						      Contact Details
					      </div>
					      <table border="0" cellpadding="0" cellspacing="0">
						      <tr>
							      <td><asp:Literal ID="DefaultEditContactTitleLiteral" runat="server" Text="Title" /></td>
							      <td>
								      <asp:HiddenField ID="DefaultEditContactIdField" runat="server" />
								      <asp:TextBox ID="DefaultEditContactTitleTextBox" runat="server" MaxLength="8" />
							      </td>				
						      </tr>
						      <tr>
							      <td><asp:Literal ID="DefaultEditContactFirstNameLiteral" runat="server" Text="First Name" /></td>
							      <td>
								      <asp:TextBox ID="DefaultEditContactFirstNameTextBox" runat="server" MaxLength="50" />
								      <asp:RequiredFieldValidator ID="EditContactFirstNameRequiredValidator" runat="server" 
																						      ErrorMessage="<b>Required Field Missing:</b><br />First name is required."
																						      ControlToValidate="DefaultEditContactFirstNameTextBox"
																						      Display="None"
																						      ValidationGroup="EditContact" />
								      <cc1:ValidatorCalloutExtender ID="EditContactFirstNameRequiredValidatorCallout" runat="server" 
																							      HighlightCssClass="error" 
																							      TargetControlID="EditContactFirstNameRequiredValidator" />
							      </td>				
						      </tr>
						      <tr>
							      <td><asp:Literal ID="DefaultEditContactMiddleNameLiteral" runat="server" Text="Middle Name" /></td>
							      <td>
								      <asp:TextBox ID="DefaultEditContactMiddleNameTextBox" runat="server" MaxLength="50" />
							      </td>				
						      </tr>
						      <tr>
							      <td><asp:Literal ID="DefaultEditContactLastNameLiteral" runat="server" Text="Last Name" /></td>
							      <td>
								      <asp:TextBox ID="DefaultEditContactLastNameTextBox" runat="server" MaxLength="50" />
								      <asp:RequiredFieldValidator ID="EditContactLastNameRequiredValidator" runat="server" 
																						      ErrorMessage="<b>Required Field Missing:</b><br />Last name is required."
																						      ControlToValidate="DefaultEditContactLastNameTextBox"
																						      Display="None"
																						      ValidationGroup="EditContact" />
								      <cc1:ValidatorCalloutExtender ID="EditContactLastNameRequiredValidatorCallout" runat="server" 
																							      HighlightCssClass="error" 
																							      TargetControlID="EditContactLastNameRequiredValidator" />
							      </td>				
						      </tr>
						      <tr>
							      <td><asp:Literal ID="DefaultEditContactSuffixLiteral" runat="server" Text="Suffix" /></td>
							      <td>
								      <asp:TextBox ID="DefaultEditContactSuffixTextBox" runat="server" MaxLength="10" />
							      </td>				
						      </tr>
					      </table>
				      </div>      
				    </td>
				    <td valign="top">
				      <div class="ListPanel">
					      <cc1:CollapsiblePanelExtender ID="DefaultEditContactAddressPanelCollapsibleExtender" runat="server"
																				      TargetControlID="DefaultEditContactAddressPanel"
																				      TextLabelID="AddressHeader"
																				      CollapsedText="Addresses (Show...)"
																				      ExpandedText="Addresses (Hide...)"
																				      CollapseControlID="AddressHeader" 
																				      ExpandControlID="AddressHeader"
																				      Collapsed="true" />
					      <asp:Panel ID="DefaultEditContactAddressHeaderPanel" runat="server" CssClass="ListHeader">
						      <asp:Label ID="AddressHeader" runat="server" Text="Addresses" />
						      <div  style="float: right;">
						        <asp:ImageButton ID="AddressEditImageButton" runat="server" ImageUrl="~/Images/edit_address_16.png" AlternateText="Edit Address" ToolTip="Edit Address" OnClick="AddressEditImageButton_Click" ValidationGroup="AddressList" CausesValidation="true" style="margin-right: 4px;" />
						        <asp:ImageButton ID="AddressDeleteImageButton" runat="server" ImageUrl="~/Images/delete_16.png" AlternateText="Delete Address" ToolTip="Delete Address" OnClick="AddressDeleteImageButton_Click" ValidationGroup="AddressList" CausesValidation="true" style="margin-right: 4px;" />
						        <asp:ImageButton ID="AddressAddImageButton" runat="server" ImageUrl="~/Images/add_16.png" AlternateText="Add Address" ToolTip="Add Address" />
      						  
                    <cc1:ConfirmButtonExtender ID="AddressDeleteImageButtonConfirmExtender" runat="server"
                                               ConfirmText="Are you sure you want to delete this address?" 
                                               TargetControlID="AddressDeleteImageButton" />
						      </div>
					      </asp:Panel>
					      <asp:Panel ID="DefaultEditContactAddressPanel" runat="server">
						      <asp:ListBox ID="DefaultEditContactAddressListBox" runat="server" />
                  <asp:RequiredFieldValidator ID="AddressListBoxRequiredValidator" runat="server" 
                                              ErrorMessage="<b>Require Field</b><br />You must select an address."
                                              ControlToValidate="DefaultEditContactAddressListBox" 
                                              ValidationGroup="AddressList" 
                                              Display="None" />
                  <cc1:ValidatorCalloutExtender ID="AddressListBoxRequiredValidatorCallout" runat="server"
                                                TargetControlID="AddressListBoxRequiredValidator" 
                                                HighlightCssClass="error" />                            
					      </asp:Panel>
				      </div>
				      
				      <div class="ListPanel">
					      <cc1:CollapsiblePanelExtender ID="DefaultEditContactPhonePanelCollapsibleExtender" runat="server"
																				      TargetControlID="EditContactPhonePanel"
																				      TextLabelID="PhoneHeader"
																				      CollapsedText="Phone Numbers (Show...)"
																				      ExpandedText="Phone Numbers (Hide...)"
																				      CollapseControlID="PhoneHeader" 
																				      ExpandControlID="PhoneHeader"
																				      Collapsed="true" />
					      <asp:Panel ID="EditContactPhoneHeaderPanel" runat="server" CssClass="ListHeader">
						      <asp:Label ID="PhoneHeader" runat="server" Text="Phone Numbers" />
						      <div  style="float: right;">
						        <asp:ImageButton ID="PhoneEditImageButton" runat="server" ImageUrl="~/Images/edit_telephone_16.png" AlternateText="Edit Phone" ToolTip="Edit Phone Number" OnClick="PhoneEditImageButton_Click" ValidationGroup="PhoneList" CausesValidation="true" style="margin-right: 4px;" />
						        <asp:ImageButton ID="PhoneDeleteImageButton" runat="server" ImageUrl="~/Images/delete_16.png" AlternateText="Delete Phone" ToolTip="Delete Phone Number" OnClick="PhoneDeleteImageButton_Click" ValidationGroup="PhoneList" CausesValidation="true" style="margin-right: 4px;" />
						        <asp:ImageButton ID="PhoneAddImageButton" runat="server" ImageUrl="~/Images/add_16.png" AlternateText="Add Phone" ToolTip="Add Phone Number" />
      						  
                    <cc1:ConfirmButtonExtender ID="PhoneDeleteImageButtonConfirmExtender" runat="server"
                                               ConfirmText="Are you sure you want to delete this phone number?" 
                                               TargetControlID="PhoneDeleteImageButton" />
						      </div>
					      </asp:Panel>
					      <asp:Panel ID="EditContactPhonePanel" runat="server">
						      <asp:ListBox ID="EditContactPhoneListBox" runat="server" />
                  <asp:RequiredFieldValidator ID="EditContactPhoneListBoxRequiredValidator" runat="server" 
                                              ErrorMessage="<b>Require Field</b><br />You must select a phone number."
                                              ControlToValidate="EditContactPhoneListBox" 
                                              ValidationGroup="PhoneList" 
                                              Display="None" />
                  <cc1:ValidatorCalloutExtender ID="EditContactPhoneListBoxRequiredValidatorCallout" runat="server"
                                                TargetControlID="EditContactPhoneListBoxRequiredValidator" 
                                                HighlightCssClass="error" />                            
					      </asp:Panel>
				      </div>
				      
				      <div class="ListPanel">
					      <cc1:CollapsiblePanelExtender ID="EditContactEmailPanelCollapsibleExtender" runat="server"
																				      TargetControlID="EditContactEmailPanel"
																				      TextLabelID="EmailHeader"
																				      CollapsedText="Email Addresses (Show...)"
																				      ExpandedText="Email Addresses (Hide...)"
																				      CollapseControlID="EmailHeader" 
																				      ExpandControlID="EmailHeader"
																				      Collapsed="true" />
					      <asp:Panel ID="EditContactEmailHeaderPanel" runat="server" CssClass="ListHeader">
						      <asp:Label ID="EmailHeader" runat="server" Text="Email Addresses" />
						      <div  style="float: right;">
						        <asp:ImageButton ID="EmailEditImageButton" runat="server" ImageUrl="~/Images/edit_address_16.png" AlternateText="Edit Email" ToolTip="Edit Email Address" OnClick="EmailEditImageButton_Click" ValidationGroup="EmailList" CausesValidation="true" style="margin-right: 4px;" />
						        <asp:ImageButton ID="EmailDeleteImageButton" runat="server" ImageUrl="~/Images/delete_16.png" AlternateText="Delete Email" ToolTip="Delete Email Address" OnClick="EmailDeleteImageButton_Click" ValidationGroup="EmailList" CausesValidation="true" style="margin-right: 4px;" />
						        <asp:ImageButton ID="EmailAddImageButton" runat="server" ImageUrl="~/Images/add_16.png" AlternateText="Add Email" ToolTip="Add Email Address" />
      						  
                    <cc1:ConfirmButtonExtender ID="EmailDeleteImageButtonConfirmExtender" runat="server"
                                               ConfirmText="Are you sure you want to delete this email address?" 
                                               TargetControlID="EmailDeleteImageButton" />
						      </div>
					      </asp:Panel>
					      <asp:Panel ID="EditContactEmailPanel" runat="server">
						      <asp:ListBox ID="EditContactEmailListBox" runat="server" />
                  <asp:RequiredFieldValidator ID="EditContactEmailRequiredValidator" runat="server" 
                                              ErrorMessage="<b>Require Field</b><br />You must select an email address."
                                              ControlToValidate="EditContactEmailListBox" 
                                              ValidationGroup="EmailList" 
                                              Display="None" />
                  <cc1:ValidatorCalloutExtender ID="EditContactEmailRequiredValidatorValidatorCallout" runat="server"
                                                TargetControlID="EditContactEmailRequiredValidator" 
                                                HighlightCssClass="error" />
					      </asp:Panel>
				      </div>
				    </td>
				  </tr>
				</table>
			</asp:Panel>
			
			<!--Add Address Panel-->
			<cc1:ModalPopupExtender ID="EditContactAddAddressPanelPopupExtender" runat="server" 
															PopupControlID="EditContactAddAddressPanel" 
															TargetControlID="AddressAddImageButton" 
															BackgroundCssClass="modalBackground" 
															CancelControlID="AddAddressCloseButton" />
															
			<asp:Panel ID="EditContactAddAddressPanel" runat="server" CssClass="PopupPanel" style="display: none;">
			  <div class="PopupHeader">
					Add Address
					<div style="float: right">
					  <asp:ImageButton ID="AddAddressSaveButton" runat="server" ImageUrl="~/Images/save_16.png" AlternateText="Save Address" ToolTip="Save Address" OnClick="AddAddressSaveButton_Click" ValidationGroup="AddAddress" style="margin-right: 4px;" />
					  <asp:ImageButton ID="AddAddressCloseButton" runat="server" ImageUrl="~/Images/close_16.png" AlternateText="Close" ToolTip="Close" />
					</div>
				</div>
			  <table border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td colspan="2">
							<asp:ValidationSummary ID="AddAddressValidation" runat="server" ValidationGroup="AddAddress" DisplayMode="List" />
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<asp:CheckBox ID="AddAddressFromExisting" runat="server" Text="From Existing" OnCheckedChanged="AddAddressFromExisting_CheckedChanged" AutoPostBack="true" />
						</td>
          </tr>
          <tr>
						<td colspan="2" style="padding-bottom: 10px;">
							<asp:DropDownList ID="AddAddressExistingDropDown" runat="server" Enabled="false" OnSelectedIndexChanged="AddAddressExistingDropDown_SelectedIndexChanged" AutoPostBack="true" Width="200px" Visible="false" />
						</td>
					</tr>
			    <tr>
			      <td><asp:Literal ID="AddAddressLine1Literal" runat="server" Text="Street Address" /></td>
			      <td>
							<asp:TextBox ID="AddAddressLine1TextBox" runat="server" MaxLength="60" />
							<asp:RequiredFieldValidator ID="AddAddressLine1RequiredValidator" runat="server" 
																					ErrorMessage="Street Address is required"
																					Display="None" 
																					ValidationGroup="AddAddress" 
																					ControlToValidate="AddAddressLine1TextBox" />
						</td>
			    </tr>
			    <tr>
			      <td><asp:Literal ID="AddAddressLine2Literal" runat="server" Text="Apartment #" /></td>
			      <td><asp:TextBox ID="AddAddressLine2TextBox" runat="server" MaxLength="60" /></td>
			    </tr>
			    <tr>
			      <td><asp:Literal ID="AddAddressCityLiteral" runat="server" Text="City" /></td>
			      <td>
							<asp:TextBox ID="AddAddressCityTextBox" runat="server" MaxLength="30" />
							<asp:RequiredFieldValidator ID="AddAddressCityRequiredValidator" runat="server" 
																					ErrorMessage="City is required"
																					Display="None" 
																					ValidationGroup="AddAddress" 
																					ControlToValidate="AddAddressCityTextBox" />
						</td>
			    </tr>
			    <tr>
			      <td><asp:Literal ID="AddAddressStateLiteral" runat="server" Text="State" /></td>
			      <td>
							<asp:DropDownList ID="AddAddressStateDropDown" runat="server" />
							<asp:RequiredFieldValidator ID="AddAddressStateRequiredValidator" runat="server" 
																					ErrorMessage="State is required"
																					Display="None" 
																					ValidationGroup="AddAddress" 
																					ControlToValidate="AddAddressStateDropDown" />
						</td>
			    </tr>
			    <tr>
			      <td><asp:Literal ID="AddAddressPostcodeLiteral" runat="server" Text="Zipcode" /></td>
			      <td>
							<asp:TextBox ID="AddAddressPostcodeTextBox" runat="server" MaxLength="5" />
							<asp:RequiredFieldValidator ID="AddAddressPostcodeRequiredValidator" runat="server" 
																					ErrorMessage="Zipcode is required"
																					Display="None" 
																					ValidationGroup="AddAddress" 
																					ControlToValidate="AddAddressPostcodeTextBox" />
						</td>
			    </tr>
			    <tr>
			      <td><asp:Literal ID="AddAddressTypeLiteral" runat="server" Text="Type" /></td>
			      <td>
							<asp:DropDownList ID="AddAddressTypeDropDown" runat="server" />
							<asp:RequiredFieldValidator ID="AddAddressTypeRequiredValidator" runat="server" 
																					ErrorMessage="Address Type is required"
																					Display="None" 
																					ValidationGroup="AddAddress" 
																					ControlToValidate="AddAddressTypeDropDown" />
						</td>
			    </tr>
			  </table>
			</asp:Panel>
			
			<!--Edit Address Panel-->
			<cc1:ModalPopupExtender ID="EditContactEditAddressPanelPopupExtender" runat="server" 
															PopupControlID="EditContactEditAddressPanel" 
															TargetControlID="EditHiddenAction" 
															BackgroundCssClass="modalBackground" 
															CancelControlID="EditAddressCloseButton" />
			<asp:LinkButton ID="EditHiddenAction" runat="server" style="visibility: visible;" />
			<asp:Panel ID="EditContactEditAddressPanel" runat="server" CssClass="PopupPanel" style="display: none;">
			  <div class="PopupHeader">
					Edit Address
					<div style="float: right">
					  <asp:ImageButton ID="EditAddressSaveButton" runat="server" ImageUrl="~/Images/save_16.png" AlternateText="Save Address" ToolTip="Save Address" OnClick="EditAddressSaveButton_Click" ValidationGroup="EditAddress" style="margin-right: 4px;" />
					  <asp:ImageButton ID="EditAddressCloseButton" runat="server" ImageUrl="~/Images/close_16.png" AlternateText="Close" ToolTip="Close" />
					</div>
				</div>
			  <table border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td colspan="2">
							<asp:ValidationSummary ID="EditAddressValidationSummary" runat="server" ValidationGroup="EditAddress" DisplayMode="List" />
						</td>
					</tr>
			    <tr>
			      <td>
			        <asp:HiddenField ID="EditAddressIdField" runat="server" />
			        <asp:Literal ID="EditAddressLine1Literal" runat="server" Text="Street Address" />
			      </td>
			      <td>
							<asp:TextBox ID="EditAddressLine1TextBox" runat="server" MaxLength="60" />
							<asp:RequiredFieldValidator ID="EditAddressLine1RequiredValidator" runat="server" 
																					ErrorMessage="Street Address is required"
																					Display="None" 
																					ValidationGroup="EditAddress" 
																					ControlToValidate="EditAddressLine1TextBox" />
						</td>
			    </tr>
			    <tr>
			      <td><asp:Literal ID="EditAddressLine2Literal" runat="server" Text="Apartment #" /></td>
			      <td><asp:TextBox ID="EditAddressLine2TextBox" runat="server" MaxLength="60" /></td>
			    </tr>
			    <tr>
			      <td><asp:Literal ID="EditAddressCityLiteral" runat="server" Text="City" /></td>
			      <td>
							<asp:TextBox ID="EditAddressCityTextBox" runat="server" MaxLength="30" />
							<asp:RequiredFieldValidator ID="EditAddressCityRequiredValidator" runat="server" 
																					ErrorMessage="City is required"
																					Display="None" 
																					ValidationGroup="EditAddress" 
																					ControlToValidate="EditAddressCityTextBox" />
						</td>
			    </tr>
			    <tr>
			      <td><asp:Literal ID="EditAddressStateLiteral" runat="server" Text="State" /></td>
			      <td>
							<asp:DropDownList ID="EditAddressStateDropDown" runat="server" />
							<asp:RequiredFieldValidator ID="EditAddressStateRequiredValidator" runat="server" 
																					ErrorMessage="State is required"
																					Display="None" 
																					ValidationGroup="EditAddress" 
																					ControlToValidate="EditAddressStateDropDown" />
						</td>
			    </tr>
			    <tr>
			      <td><asp:Literal ID="EditAddressPostcodeLiteral" runat="server" Text="Zipcode" /></td>
			      <td>
							<asp:TextBox ID="EditAddressPostcodeTextBox" runat="server" MaxLength="5" />
							<asp:RequiredFieldValidator ID="EditAddressPostcodeRequiredValidator" runat="server" 
																					ErrorMessage="Zipcode is required"
																					Display="None" 
																					ValidationGroup="EditAddress" 
																					ControlToValidate="EditAddressPostcodeTextBox" />
						</td>
			    </tr>
			    <tr>
			      <td><asp:Literal ID="EditAddressTypeLiteral" runat="server" Text="Type" /></td>
			      <td>
							<asp:DropDownList ID="EditAddressTypeDropDown" runat="server" Enabled="false" />
							<asp:RequiredFieldValidator ID="EditAddressTypeRequiredValidator" runat="server" 
																					ErrorMessage="Address type is required"
																					Display="None" 
																					ValidationGroup="EditAddress" 
																					ControlToValidate="EditAddressTypeDropDown" />
						</td>
			    </tr>
			  </table>
			</asp:Panel>
			
			<!--Add Phone Number Panel-->
			<cc1:ModalPopupExtender ID="AddPhonePopupExtender" runat="server" 
															PopupControlID="EditContactAddPhonePanel" 
															TargetControlID="PhoneAddImageButton" 
															BackgroundCssClass="modalBackground" 
															CancelControlID="AddPhoneCloseImageButton" />
			<asp:Panel ID="EditContactAddPhonePanel" runat="server" CssClass="PopupPanel" style="display: none;">
			  <div class="PopupHeader">
					Add Phone Number
					<div style="float: right">
					  <asp:ImageButton ID="AddPhoneSaveImageButton" runat="server" ImageUrl="~/Images/save_16.png" AlternateText="Save Phone Number" ToolTip="Save Phone Number" OnClick="AddPhoneSaveImageButton_Click" ValidationGroup="AddPhone" style="margin-right: 4px;" />
					  <asp:ImageButton ID="AddPhoneCloseImageButton" runat="server" ImageUrl="~/Images/close_16.png" AlternateText="Close" ToolTip="Close" />
					</div>
				</div>
			  <table border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td colspan="2">
							<asp:ValidationSummary ID="AddPhoneValidationSummary" runat="server" ValidationGroup="AddPhone" DisplayMode="List" />
						</td>
					</tr>
			    <tr>
			      <td>
			        <asp:Literal ID="AddPhoneNumberLiteral" runat="server" Text="Phone Number" />
			      </td>
			      <td>
							<asp:TextBox ID="AddPhoneNumberTextBox" runat="server" MaxLength="14" />
							<asp:RequiredFieldValidator ID="AddPhoneNumberRequiredValidator" runat="server" 
																					ErrorMessage="Phone number is required"
																					Display="None" 
																					ValidationGroup="AddPhone" 
																					ControlToValidate="AddPhoneNumberTextBox" />
						</td>
			    </tr>
			    <tr>
			      <td><asp:Literal ID="AddPhoneNumberTypeLiteral" runat="server" Text="Type" /></td>
			      <td>
							<asp:DropDownList ID="AddPhoneNumberTypeDropDown" runat="server" />
							<asp:RequiredFieldValidator ID="AddPhoneNumberTypeRequiredValidator" runat="server" 
																					ErrorMessage="Phone Number Type is required"
																					Display="None" 
																					ValidationGroup="AddPhone" 
																					ControlToValidate="AddPhoneNumberTypeDropDown" />
						</td>
			    </tr>
			  </table>
			</asp:Panel>
			
			<!--Edit Phone Number Panel-->
			<cc1:ModalPopupExtender ID="EditContactEditPhonePanelPopupExtender" runat="server" 
															PopupControlID="EditContactEditPhonePanel" 
															TargetControlID="EditHiddenAction" 
															BackgroundCssClass="modalBackground" 
															CancelControlID="EditPhoneCancelImageButton" />
			<asp:Panel ID="EditContactEditPhonePanel" runat="server" CssClass="PopupPanel" style="display: none;">
			  <div class="PopupHeader">
					Edit Phone Number
					<div style="float: right">
					  <asp:ImageButton ID="EditPhoneSaveImageButton" runat="server" ImageUrl="~/Images/save_16.png" AlternateText="Save Phone Number" ToolTip="Save Phone Number" OnClick="EditPhoneSaveImageButton_Click" ValidationGroup="EditPhone" style="margin-right: 4px;" />
					  <asp:ImageButton ID="EditPhoneCancelImageButton" runat="server" ImageUrl="~/Images/close_16.png" AlternateText="Close" ToolTip="Close" />
					</div>
				</div>
			  <table border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td colspan="2">
							<asp:ValidationSummary ID="EditPhoneValidationSummary" runat="server" ValidationGroup="EditPhone" DisplayMode="List" />
						</td>
					</tr>
			    <tr>
			      <td>
							<asp:HiddenField ID="EditPhoneIdField" runat="server" />
			        <asp:Literal ID="EditPhoneLiteral" runat="server" Text="Phone Number" />
			      </td>
			      <td>
							<asp:TextBox ID="EditPhoneTextBox" runat="server" MaxLength="14" />
							<asp:RequiredFieldValidator ID="EditPhoneTextBoxRequiredValidator" runat="server" 
																					ErrorMessage="Phone number is required"
																					Display="None" 
																					ValidationGroup="EditPhone" 
																					ControlToValidate="EditPhoneTextBox" />
						</td>
			    </tr>
			    <tr>
			      <td><asp:Literal ID="EditPhoneTypeLiteral" runat="server" Text="Type" /></td>
			      <td>
							<asp:DropDownList ID="EditPhoneTypeDropDown" runat="server" />
							<asp:RequiredFieldValidator ID="EditPhoneTypeRequiredValidator" runat="server" 
																					ErrorMessage="Phone Number Type is required"
																					Display="None" 
																					ValidationGroup="EditPhone" 
																					ControlToValidate="EditPhoneTypeDropDown" />
						</td>
			    </tr>
			  </table>
			</asp:Panel>
			
			<!--Add Email Address Panel-->
			<cc1:ModalPopupExtender ID="EditContactAddEmailPanelPopupExtender" runat="server" 
															PopupControlID="EditContactAddEmailPanel" 
															TargetControlID="EmailAddImageButton" 
															BackgroundCssClass="modalBackground" 
															CancelControlID="AddEmailCloseImageButton" />
			<asp:Panel ID="EditContactAddEmailPanel" runat="server" CssClass="PopupPanel" style="display: none;">
			  <div class="PopupHeader">
					Add Email Address
					<div style="float: right">
					  <asp:ImageButton ID="AddEmailSaveImageButton" runat="server" ImageUrl="~/Images/save_16.png" AlternateText="Save Email Address" ToolTip="Save Email Address" OnClick="AddEmailSaveImageButton_Click" ValidationGroup="AddEmail" style="margin-right: 4px;" />
					  <asp:ImageButton ID="AddEmailCloseImageButton" runat="server" ImageUrl="~/Images/close_16.png" AlternateText="Close" ToolTip="Close" />
					</div>
				</div>
			  <table border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td colspan="2">
							<asp:ValidationSummary ID="AddEmailValidationSummary" runat="server" ValidationGroup="AddEmail" DisplayMode="List" />
						</td>
					</tr>
			    <tr>
			      <td>
			        <asp:Literal ID="AddEmailLiteral" runat="server" Text="Email Address" />
			      </td>
			      <td>
							<asp:TextBox ID="AddEmailTextBox" runat="server" MaxLength="50" />
							<asp:RequiredFieldValidator ID="AddEmailTextBoxRequiredValidator" runat="server" 
																					ErrorMessage="Email address is required"
																					Display="None" 
																					ValidationGroup="AddEmail" 
																					ControlToValidate="AddEmailTextBox" />
						</td>
			    </tr>
			    <tr>
			      <td><asp:Literal ID="AddEmailTypeLiteral" runat="server" Text="Type" /></td>
			      <td>
							<asp:DropDownList ID="AddEmailTypeDropDown" runat="server" />
							<asp:RequiredFieldValidator ID="AddEmailTypeRequiredValidator" runat="server" 
																					ErrorMessage="Email Address Type is required"
																					Display="None" 
																					ValidationGroup="AddEmail" 
																					ControlToValidate="AddEmailTypeDropDown" />
						</td>
			    </tr>
			  </table>
			</asp:Panel>
			
			<!--Edit Email Address Panel-->
			<cc1:ModalPopupExtender ID="EditContactEditEmailPanelPopupExtender" runat="server" 
															PopupControlID="EditContactEditEmailPanel" 
															TargetControlID="EditHiddenAction" 
															BackgroundCssClass="modalBackground" 
															CancelControlID="EditEmailCloseImageButton" />
			<asp:Panel ID="EditContactEditEmailPanel" runat="server" CssClass="PopupPanel" style="display: none;">
			  <div class="PopupHeader">
					Edit Email Address
					<div style="float: right">
					  <asp:ImageButton ID="EditEmailSaveImageButton" runat="server" ImageUrl="~/Images/save_16.png" AlternateText="Save Email Address" ToolTip="Save Email Address" OnClick="EditEmailSaveImageButton_Click" ValidationGroup="EditEmail" style="margin-right: 4px;" />
					  <asp:ImageButton ID="EditEmailCloseImageButton" runat="server" ImageUrl="~/Images/close_16.png" AlternateText="Close" ToolTip="Close" />
					</div>
				</div>
			  <table border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td colspan="2">
							<asp:ValidationSummary ID="EditEmailValidationSummary" runat="server" ValidationGroup="EditEmail" DisplayMode="List" />
						</td>
					</tr>
			    <tr>
			      <td>
			        <asp:HiddenField ID="EditEmailIdField" runat="server" />
			        <asp:Literal ID="EditEmailLiteral" runat="server" Text="Email Address" />
			      </td>
			      <td>
							<asp:TextBox ID="EditEmailTextBox" runat="server" MaxLength="50" />
							<asp:RequiredFieldValidator ID="EditEmailTextBoxRequiredValidator" runat="server" 
																					ErrorMessage="Email address is required"
																					Display="None" 
																					ValidationGroup="EditEmail" 
																					ControlToValidate="EditEmailTextBox" />
						</td>
			    </tr>
			    <tr>
			      <td><asp:Literal ID="EditEmailTypeLiteral" runat="server" Text="Type" /></td>
			      <td>
							<asp:DropDownList ID="EditEmailTypeDropDown" runat="server" />
							<asp:RequiredFieldValidator ID="EditEmailTypeRequiredValidator" runat="server" 
																					ErrorMessage="Email Address Type is required"
																					Display="None" 
																					ValidationGroup="EditEmail" 
																					ControlToValidate="EditEmailTypeDropDown" />
						</td>
			    </tr>
			  </table>
			</asp:Panel>
		</asp:View>
	</asp:MultiView>
</asp:Content>